package com.py.credit.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.py.credit.entity.Column;
import com.py.credit.entity.common.OptionalColumn;
import com.py.credit.entity.common.TreeObj;
import com.py.framework.core.common.Page;

public interface ColumnDao {

	void addColumns(@Param(value = "list") List<Column> list);

	List<Column> selectListByTableId(@Param(value = "tableId") int tableId);

	List<Column> selectListByTableIdForPage(@Param(value = "tableId") Integer tableId,
			@Param(value = "page") Page page);

	void delColumns(@Param(value = "list") List<Column> delColumns);

	int updateByPrimaryKey(Column column);

	int insert(Column column);

	List<Column> getList(@Param(value = "metricCode") String metricCode,
			@Param(value = "metricName") String metricName);

	List<TreeObj> selectColumnNodes(@Param(value = "tableId") int tableId);

	List<String> selectColumnENByTableId(@Param(value = "tableId") int tableId);

	List<OptionalColumn> selectOptionalColumnByTableId(@Param(value = "tableId") int tableId);

	List<HashMap<String, String>> selectColumn(@Param(value = "tableId") int tableId);

	List<TreeObj> selectColNodesFromCommonContentTable(@Param(value = "tableId") String tableId);

	List<Column> selectNodesFromCommonContent(@Param(value = "tableId") String tableId);

	List<Map<String, String>> getAllTimeMetricByTableId(@Param(value = "tableId") Long tableId);

	String getValueBySql(@Param(value = "sql") String sql);

	/**
	 * 功能描述: 获取tybm
	 *
	 * @param mainName 主体名称
	 * @return 校验结果
	 * @author YaoS
	 * @date 19/4/25 17:24
	 */
	String selectTybm(@Param(value = "mainName") String mainName);

	void updateColunmCubeSort(@Param(value = "tableId") Integer tableId, @Param(value = "sort") Integer sort,
			@Param(value = "metricId") Integer metricId);
}
